package com.ycy.temperature.servicrapi;


import com.ycy.temperature.bean.ActivityBean;
import com.ycy.temperature.bean.BannerBean;
import com.ycy.temperature.bean.DynamicBean;
import com.ycy.temperature.bean.LabelBean;
import com.ycy.temperature.bean.LoginBean;
import com.ycy.temperature.bean.VerificationBean;
import com.ycy.temperature.bean.VipListBean;
import com.ycy.temperature.bean.ＭeBean;

import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;
import rx.Observable;

/**
 * 接口参数界面
 */
public interface UserApi {
    /**
     * 登录接口
     *
     * @param mobile   手机号
     * @param password 密码
     * @return
     */
    @FormUrlEncoded
    @POST("user/login.do")
    Observable<LoginBean> getLogin(
            @Field("mobile") String mobile,
            @Field("password") String password);

    /**
     * 注册接口
     *
     * @param usermobile 手机号
     * @param verifyCode 验证码
     * @param password   密码
     * @param type       类型
     * @return
     */
    @FormUrlEncoded
    @POST("user/validateCodeFlag.do")
    Observable<VerificationBean> getRegister(
            @Field("mobile") String usermobile,
            @Field("validateCode") String verifyCode,
            @Field("password") String password,
            @Field("type") String type);

    /**
     * 获取验证码接口
     *
     * @param phone 手机号
     * @param type  类型
     * @return
     */
    @FormUrlEncoded
    @POST("user/doSendCode.do")
    Observable<VerificationBean> getVerification(
            @Field("phone") String phone,
            @Field("type") String type);

    /**
     * 获取用户信息
     *
     * @param uId
     * @return
     */
    @FormUrlEncoded
    @POST("user/getUserById.do")
    Observable<VerificationBean> getMe(
            @Field("uId") String uId);

    /**
     * 修改用户信息
     *
     * @param age             年龄
     * @param nativeplace
     * @param city
     * @param marriage
     * @param children
     * @param height
     * @param hobby
     * @param monthincome
     * @param weight
     * @param smoke
     * @param drinkwine
     * @param symbolicanimals
     * @param religion
     * @return
     */
    @FormUrlEncoded
    @POST("user/addUser.do")
    Observable<VerificationBean> getInformation(
            @Field("usermobile") String usermobile,
            @Field("password") String password,
            @Field("age") String age,
            @Field("nativeplace") String nativeplace,
            @Field("city") String city,
            @Field("marriage") String marriage,
            @Field("children") String children,
            @Field("height") String height,
            @Field("hobby") String hobby,
            @Field("monthincome") String monthincome,
            @Field("weight") String weight,
            @Field("smoke") String smoke,
            @Field("drinkwine") String drinkwine,
            @Field("symbolicanimals") String symbolicanimals,
            @Field("religion") String religion,
            @Field("type") String type);

    @FormUrlEncoded
    @POST("user/updateUser.do")
    Observable<VerificationBean> getInformation(
            @Field("nickname") String nickname,
            @Field("autograph") String autograph);

    @FormUrlEncoded
    @POST("user/updateUser.do")
    Observable<VerificationBean> getInformation(
            @Field("height") String height,
            @Field("monthincome") String monthincome,
            @Field("weight") String weight,
            @Field("smoke") String smoke,
            @Field("drinkwine") String drinkwine,
            @Field("symbolicanimals") String symbolicanimals,
            @Field("religion") String religion);

    /**
     * 获取Banner
     *
     * @param uId
     * @return
     */
    @FormUrlEncoded
    @POST("homepage/banner.do")
    Observable<BannerBean> getBanner(
            @Field("uId") String uId);

    /**
     * 获取Vip列表
     *
     * @param uId
     * @return
     */
    @FormUrlEncoded
    @POST("homepage/getVIPList.do")
    Observable<VipListBean> getVipList(
            @Field("uId") String uId);

    /**
     * 获取用户信息
     *
     * @param uId
     * @return
     */
    @FormUrlEncoded
    @POST("user/getUserById.do")
    Observable<ＭeBean> getMeData(
            @Field("asdasdasd") String uId);

    /**
     * 发布活动
     *
     * @param type           类型0为发布活动 1为更改活动
     * @param title          标题
     * @param content        内容
     * @param activitytime   活动时间
     * @param lableid        用逗号拼接的标签id
     * @param releaseaddress 活动发布时用户所在的地点
     * @return
     */
    @FormUrlEncoded
    @POST("release/releaseActivity.do")
    Observable<VerificationBean> getActivity(
            @Field("type") String type,
            @Field("title") String title,
            @Field("content") String content,
            @Field("activitytime") String activitytime,
            @Field("lableid") String lableid,
            @Field("releaseaddress") String releaseaddress);

    /**
     * 活动标签
     *
     * @param type 类型0为发布活动 1为更改活动
     * @return
     */
    @FormUrlEncoded
    @POST("release/getLable.do")
    Observable<LabelBean> getLabel(
            @Field("type") String type);

    /**
     * 发布动态
     *
     * @return
     */
    @FormUrlEncoded
    @POST("release/releaseCircle.do")
    Observable<VerificationBean> getDynamic(
            @Field("content") String content,
            @Field("circleimage") String circleimage,
            @Field("releaseaddress") String releaseaddress);

    /**
     * 判断能否继续发布动态
     *
     * @return
     */
    @FormUrlEncoded
    @POST("release/getCanRelease.do")
    Observable<VerificationBean> getJudgeRelease(
            @Field("content") String content);

    /**
     * 获取动态
     *
     * @return
     */
    @FormUrlEncoded
    @POST("homepage/activityAndCircle.do")
    Observable<DynamicBean> setDynamic(
            @Field("type") String type,
            @Field("begin") String begin,
            @Field("page") String page);

    /**
     * 获取个人动态
     *
     * @return
     */
    @FormUrlEncoded
    @POST("homepage/activityAndCircle.do")
    Observable<DynamicBean> setDynamic(
            @Field("type") String type,
            @Field("isUser") String isUser,
            @Field("begin") String begin,
            @Field("page") String page);

    /**
     * 获取活动
     *
     * @return
     */
    @FormUrlEncoded
    @POST("homepage/activityAndCircle.do")
    Observable<ActivityBean> setActivity(
            @Field("type") String type,
            @Field("begin") String begin,
            @Field("page") String page);


    /**
     * 获取个人活动
     *
     * @return
     */
    @FormUrlEncoded
    @POST("homepage/activityAndCircle.do")
    Observable<ActivityBean> setActivity(
            @Field("type") String type,
            @Field("isUser") String isUser,
            @Field("begin") String begin,
            @Field("page") String page);


    /**
     * 动态点赞
     *
     * @param createuserid 创建动态者的id
     * @param circleid     动态id
     * @return
     */
    @FormUrlEncoded
    @POST("circle/addAssist.do")
    Observable<VerificationBean> getFabulous(
            @Field("createuserid") String type,
            @Field("circleid") String begin);

    /**
     * 删除活动
     *
     * @return
     */
    @FormUrlEncoded
    @POST("user/deleteCircleOrActivity.do")
    Observable<VerificationBean> getDeleteActivity(
            @Field("type") String type,
            @Field("activityOrCircleId") String activityOrCircleId);

}
